package work1;

public class Rectangle extends Graph {
    private double length,wide;

    public Rectangle() {
    }

    public Rectangle(double length, double wide,String color,boolean fill) {
        super(color, fill);
        this.length = length;
        this.wide = wide;
    }

    public double getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public double getWide() {
        return wide;
    }

    public void setWide(int wide) {
        this.wide = wide;
    }

    @Override
    double getArea() {
        return length*wide;
    }

    @Override
    double getPrimeter() {
        return 2*(length+wide);
    }

    @Override
    public String toString() {
        return "长方形的长为:" + length + "长方形的宽为:" + wide +",长方形的颜色为:" + color + ",是否填充颜色:" + (fill? "是":"否") + ",圆的面积为:" + getArea() + ",圆的周长为:" + getPrimeter();
    }
}
